Advanced Deployment
-------------------------------------------------- 
Below is a list of the Content Courier objects you can build and extend, as well as some suggestions for solutions to common problems that may crop up.  There's also documentation in the source itself, with phpdoc style blocks.

ContentLoaders
-------------------------------------------------- 
ContentLoaders are covered in detail in the <a href="/documentation/deployment">Deployment</a> documentation.  They inherit from a base abstract class named ContentCourierLoaderFactory, they should be named with the ContentCourierLoaderNAME convention, and are instantiated in the index.php file. 


ContentCourier Application 
-------------------------------------------------- 
The main ContentCourier application also inherits from an abstract class, this one named ContentCourierFactory.  If you wish to extend this class you should name it with ContentCourierNAME convention.  

    class ContentCourierYourNameHere extends ContentCourier{...}

You can override/create any methods that suit your needs.  Then, in index.php, specify your class in the first argument of the factory's getInstance method

    $cds = ContentCourierFactory::getInstance('YourNameHere',...);
    
SiteConfig and SectionConfig Elements
-------------------------------------------------- 
There are two different config objects, one for the entire site, the other for each individual section of a site.  By default, the ContentCourier system uses an XML file to store this configuration information, and a SimpleXMLElement object to retrieve the information.  You may override the default behavior and use whatever method you prefer to store and load your site configuration information.

Similar to the ContentCourier Application and Loader, the site config object inherits from an abstract class, named ContentCourierConfigSite.  If you wish to extend this class you should name it with ContentCourierConfigSiteNAME convention.  

    class ContentCourierConfigSiteMyConfig extends ContentCourierConfigSiteFactory
    
The index.php front controller is where you'll specify your class

    $cds = ContentCourierFactory::getInstance('default','FileSystem','MyConfig',...);
    
The section config also inherits from an abstract base class. If you wish to extend this class you should name it with ContentCourierConfigSectionNAME convention.

    ContentCourierConfigSectionMyName extends extends ContentCourierConfigSectionFactory
    
Instantiating your section config objects is a little less straight forward. The **site** config object has a method named *getArrayOfSectionConfigs*.  This method is responsible for returning an array of Section configs

    $oSectionConfig = ContentCourierConfigSectionFactory::getInstance('XML',$section->asXML());

Because of this, if you want to extend/override the section config object you'll need to first override the getArrayOfSectionConfigs method in the site config.

Options Array
-------------------------------------------------- 
The third argument to ContentCourierFactory::getInstance is a single dimention array of key/value pairs.  A 'config-uri' key is the only option required by the ContentCourier system, (in the default implementation this is a file-path).

If you want to use the $options array in your own deployment, create your own ContentCourier Application (as described above), and override the handleOptions method

    protected function handleOptions($options){
        $this->contentLoader->basePath = $options['base-file-path'];        
        //do other stuff with the options
        
        //not needed, the base handleOptions does nothing (config-uri
        //is handled elsewhere
        //parent::handleOptions($options);
    }
    


